# Contributor: Hakan Erduman <hakan@erduman.de>
# Maintainer: Hakan Erduman <hakan@erduman.de>
pkgname=zutty
pkgver=0.14
pkgrel=0
pkgdesc="Zero-cost unicode teletype - a high-end terminal for low-end systems"
url="https://tomscii.sig7.se/zutty"
arch="all !x86"
license="GPL-3.0-or-later"
makedepends="
	freetype-dev
	libxmu-dev
	mesa-dev
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/tomscii/zutty/archive/refs/tags/$pkgver.tar.gz"
options="!check" # only manual tests available

build() {
	python3 waf configure  --prefix=/usr
	python3 waf build
}

package() {
	python3 waf install --destdir="$pkgdir"
	# upstream does not handle localization so .desktop and icons are as-is
	install -Dm664 "$srcdir/$pkgname-$pkgver"/icons/zutty.desktop "$pkgdir"/usr/share/applications/zutty.desktop
	install -Dm664 "$srcdir/$pkgname-$pkgver"/icons/zutty.svg "$pkgdir"/usr/share/icons/hicolor/scalable/apps/zutty.svg
	for d in "$srcdir/$pkgname-$pkgver"/icons/zutty_*x*.png; do
		dd=$(basename "$d" .png | cut -d'_' -f2)
		install -Dm664 "$d" "$pkgdir"/usr/share/icons/hicolor/"$dd"/zutty.png
	done
	# upstream has no man-page, just org-mode ASCII text
}

sha512sums="
d73894feefa1fb58c76aa5f9d68a47b9871ab8d02eb5dd2575769c4f082a65cb9df2bdb2478e5aa54d121eb19a16269f169e79d72f0df779760520f2d501c086  zutty-0.14.tar.gz
"
